<?php if ($news_content->num_rows() >0): ?>
    <div class="notice">
        <?php foreach ($news_content->result() as $key => $val ): ?>
            <a href="<?php echo site_url('home/home/noticeDetail/'.$val->id);?>">
                <?php if ($key == 0): ?>
                    <p><?php echo $val->title;?></p>
                    <ul class="flex">
                        <?php if (!empty($val->image)): ?>
                            <?php $i=1;foreach (explode('|', $val->image) as $key => $value): ?>
                                <?php if($i==4) break;?>
                                <?php if (!empty($value)): ?>
                                    <li class="flex-1"><img src="<?php echo $this->config->show_image_url($value)?>"></li>
                                <?php endif ?>
                            <?php $i++;endforeach ?>
                        <?php endif ?>
                    </ul>
                    <div class="txt"><?php echo strip_tags($val->content);?></div>
                    <div class="other am-cf">
                        <span><em><?php echo $val->class_name;?></em><?php echo !empty($val->edit_time) ? time_tran(date("Y-m-d", $val->edit_time)) : time_tran(date("Y-m-d", $val->create_time));?></span>
                        <div class="number">
                            <i class="iconfont"></i>
                            <span><i class="iconfont">&#xe663;</i><?php echo $val->pv;?></span>
                        </div>
                    </div>
                <?php endif ?>
            </a>
        <?php endforeach ?>
    </div>
<?php endif ?>
<?php if ($news_content->num_rows() >0): ?>
<ul class="noticeMore am-cf index-notice-list">
    <?php foreach ($news_content->result() as $key => $val ): ?>
        <?php if ($key >0): ?>
            <li>
                <a class="flex" href="<?php echo site_url('home/home/noticeDetail/'.$val->id);?>">
                    <?php if (!empty($val->image)): ?>
                        <?php $i=1;foreach (explode('|', $val->image) as $key => $value): ?>
                            <?php if($i==2) break;?>
                            <?php if (!empty($value)): ?>
                                <img src="<?php echo $this->config->show_image_url($value)?>">
                            <?php endif ?>
                        <?php $i++;endforeach ?>
                    <?php endif ?>
                    <div class="content flex-1">
                        <p><?php echo $val->title;?></p>
                        <div class="details">
                            <span><em><?php echo $val->class_name;?></em><?php echo !empty($val->edit_time) ? time_tran(date("Y-m-d", $val->edit_time)) : time_tran(date("Y-m-d", $val->create_time));?></span>
                            <div class="number">
                                <i class="iconfont"></i>
                                <span><i class="iconfont">&#xe663;</i><?php echo $val->pv;?></span>
                            </div>
                        </div>
                    </div>
                </a>
            </li>
        <?php endif ?>
    <?php endforeach ?>
</ul>
<div class="index-notice-more sec-load am-scrollspy-init <?php echo $more ? '' : 'am-hide'; ?>">
    <i class="iconfont am-animation-spin">&#xe60b;</i>
</div>
<div class="no-more <?php echo $more ? 'am-hide' : ''; ?>">
    没有更多了
</div>
<div class="distanceOnePer"></div>
<?php endif ?>
<script>
    /*景区分页*/
    $(document).ready(function () {
        if ($('.index-notice-list').size() > 0) {
            var pg = 2,
                class_id = $('.notice-nav ul li.active').attr('data-class-id');
            $('.index-notice-more').scrollspy({
                animation: 'fade',
                delay: 500
            });
            $('.index-notice-more').on('inview.scrollspy.amui', function () {
                $.ajax({
                    'type': 'get',
                    'dataType': 'json',
                    'async': false,
                    'url': hostUrl() + 'home/ajaxNoticePage',
                    'data': {'pg': pg,'class_id': class_id},
                    'success': function (data) {
                        if (data.status) {
                            pg++;
                            $('.index-notice-list').append(data.content);
                            $('img.lazy').lazyload({skip_invisible: false});
                        } else {
                            $('.index-notice-more').addClass('am-hide');
                            $('.no-more').removeClass('am-hide');
                        }
                    }
                })
            })
        }
    })
</script>